﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;


namespace SchedulerControl
{
    public partial class ScheduleDayViewHeaderControl : UserControl
    {
        private DateTime _currentViewDate = DateTime.Now ;
        public DateTime CurrentViewDate
        {
            get { return _currentViewDate; }
            set
            {
                _currentViewDate = value;
                dayTitle.Text = calendar.WeekDayNames[((int)calendar.GetDayOfWeek(CurrentViewDate))] + " " + calendar.GetDayOfMonth(CurrentViewDate) + " " + calendar.MonthNames[calendar.GetMonth(CurrentViewDate)];
            }
        }
        
        private PersianCalendar calendar;
        public ScheduleDayViewHeaderControl()
        {
            InitializeComponent();
            calendar = new PersianCalendar();
            dayTitle.Text = calendar.WeekDayNames[((int)calendar.GetDayOfWeek(CurrentViewDate))] + " " + calendar.GetDayOfMonth(CurrentViewDate) + " " + calendar.MonthNames[calendar.GetMonth(CurrentViewDate)];
            dayTitle.FontFamily = new FontFamily("/SchedulerControl;component/Fonts/Fonts.zip#B Mitra");
            dayTitle.FontSize = 18;
            dayTitle.Foreground = new SolidColorBrush(Color.FromArgb(255, 40, 40, 40));

            this.MouseLeftButtonDown += new MouseButtonEventHandler(ScheduleDayViewHeaderControl_MouseLeftButtonDown);
        }

        void ScheduleDayViewHeaderControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            
        }

        private string currentDateTitle;

        public string CurrentDateTitle
        {
            get { return currentDateTitle; }
            set
            {
                currentDateTitle = value;
                dayTitle.Text = calendar.WeekDayNames[((int)calendar.GetDayOfWeek(CurrentViewDate))] + " " + calendar.GetDayOfMonth(CurrentViewDate) + " " + calendar.MonthNames[calendar.GetMonth(CurrentViewDate)];
            }
        }

        
    }
}
